home *** CD-ROM | disk | FTP | other *** search
- Path: ra.nrl.navy.mil!usenet
- From: pitre@n5160d.nrl.navy.mil (Richard Pitre)
- Newsgroups: comp.lang.c++
- Subject: Re: Will JAVA kill C++?
- Date: 13 Mar 1996 15:34:02 GMT
- Organization: Naval Research Laboratory
- Message-ID: <4i6ptb$36o@ra.nrl.navy.mil>
- References: <31471A61.3510@sdt.com>
- NNTP-Posting-Host: n5160d.nrl.navy.mil
-
- In article <31471A61.3510@sdt.com> Larry Baker <leb@sdt.com> writes:
- > Adam Megacz wrote:
- > > I'm not a Fortran buff, but I don't understand why C is faster
- > > than C++. C++ supports all C features (except the void* crap).
- > > If anything, C++'s type-checking allows more compiler
- > > optimizations, making it a slightly faster language.
- >
- > If you code _exactly_ the same way using a C++ compiler, in
- > essence using the C++ compiler to compile a "C" program, then
- > you should see no performance difference on non-optimized code.
- >
- > C vs Fortran raises a few other interesting comparisons. All variables
- > in FORTRAN are the equivalant of C "static" types - they aren't
- > dynamically pushed/popped off of the stack, as with automatic C
- > variables, or dynamically allocated using malloc/free, as they
- > may be (even as automatic, stack-based instances) in C++. Hence
- > the C runtime semantics, and moreso the C++ runtime semantics, may
- > incur some slight "background" overhead when compared to a much
- > simpler language like FORTRAN.
- >
- > Larry Baker
- > leb@sdt.com
-
- I agree with what Larry is saying. A programmer, who has some sense of how C,
- C++, and Fortran are typically implemented, can do everything efficiently in
- C++ with the added advantage of classes. C++ gives you fine control over
- efficiency and organization and the compromise between them.
-
- IMHO C++ is a tool only for experienced and disciplined professionals. I think
- that it is important for programmers to understand the motivational issues
- behind the C++ features and the place to find that motivation is in
- Stroustrup's excellent writings. Some people complain about the difficulty of
- these books but I believe that much of the difficulty is inherent in the
- subject i.e. C++ is complex and subtle to the point that people seem to have
- difficulty in correctly implementing some of its more useful features. This
- reading should be a sober experience for anyone making claims for C++ as an
- ideal all purpose tool for the programming masses. The notion that less
- experienced programmers will somehow confine themselves to a somewhat safe
- subset of the language is a foolish notion. The popularity of C/C++ is a
- serious problem not only for people who need other tools but perhaps for the
- future of C/C++ itself.
-
- Beginning and intermediate programmers should use something other than C++
- until they understand what programming is really about. Pascal lineage
- programming tools(and perhaps JAVA) are good alternatives for beginning,
- intermediate and many professional programmers, although as Larry pointed out
- these languages are largely non existent thanks to the gross over popularity of
- C/C++. Of the Pascal lineage languages Ada95 is a real standard that seems to
- have significant multiplatform support and there is some inkling of a
- competitive compiler market. Ada also has some heavy duty annexes to do real
- world things. Modula 3 may also be a practical choices for many.
-
- After some experience with tamer languages and after reading something on the
- order of Stroustrup's books, a programmer can make a conscious choice to use
- C++. Many programmers may conclude that, in spite of their experience, they do
- not have the necessary discipline to code in C++. If every programmer could
- make that kind of conscious decision then there would be healthier software out
- there and there would be serious competitive alternatives to the supposed one
- true tool. Dreamland, I know.
-
- richard
-